import Loadable from "react-loadable"
import { Spin } from "antd"

function LoadingBox() {
    return (
        <div
            style={{
                width: "100%",
                height: "100%",
                display: "flex",
                justifyContent: "center",
                alignItems: "center"
            }}
        >
            <Spin size="large" tip="Loading..." />
        </div>
    )
}
const lazyload = (lazyLoadComponent, loading = LoadingBox) => Loadable({ loader: lazyLoadComponent, loading })
export default lazyload;
